<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Hard
  </div>
  <div>
   <h1 class="question_title">
    4. Median of Two Sorted Arrays
   </h1>
   <p>
    There are two sorted arrays
    <b>
     nums1
    </b>
    and
    <b>
     nums2
    </b>
    of size m and n respectively.
   </p>
   <p>
    Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).
   </p>
   <p>
    You may assume
    <strong>
     nums1
    </strong>
    and
    <strong>
     nums2
    </strong>
    &nbsp;cannot be both empty.
   </p>
   <p>
    <b>
     Example 1:
    </b>
   </p>
   <pre>
nums1 = [1, 3]
nums2 = [2]

The median is 2.0
</pre>
   <p>
    <b>
     Example 2:
    </b>
   </p>
   <pre>
nums1 = [1, 2]
nums2 = [3, 4]

The median is (2 + 3)/2 = 2.5
</pre>
  </div>
  <div>
   <h1 class="question_title">
    4. 寻找两个有序数组的中位数
   </h1>
   <p>
    给定两个大小为 m 和 n 的有序数组&nbsp;
    <code>
     nums1
    </code>
    和&nbsp;
    <code>
     nums2
    </code>
    。
   </p>
   <p>
    请你找出这两个有序数组的中位数，并且要求算法的时间复杂度为&nbsp;O(log(m + n))。
   </p>
   <p>
    你可以假设&nbsp;
    <code>
     nums1
    </code>
    &nbsp;和&nbsp;
    <code>
     nums2
    </code>
    &nbsp;不会同时为空。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre>nums1 = [1, 3]
nums2 = [2]

则中位数是 2.0
</pre>
   <p>
    <strong>
     示例 2:
    </strong>
   </p>
   <pre>nums1 = [1, 2]
nums2 = [3, 4]

则中位数是 (2 + 3)/2 = 2.5
</pre>
  </div>
 </body>
</html>